﻿@model PlmConstructionlogcivilViewModel
@{
    Layout = null;
    ViewBag.Title = "施工日志-土建评述";

    var currentCode = ViewBag.CurrentCode;
}
<form method="post" action="/PlmConstructionLogCivil/ConstructionLogCivilCommentSave"
      class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone)">
    @Html.HiddenFor(model => model.ThePlmConstructionlogcivilInfo.Clc_DirectorSection, new { Value = ViewBag.directorSection })
    @Html.HiddenFor(model => model.ThePlmConstructionlogcivilInfo.Clc_ConstructionDate, new { Value = ViewBag.constructionDate })
    <div class="pageFormContent" layouth="58">
        <table class="tab01 tabNo" width="100%">
            <tr>
                <td class="td1" style="width:25%;">
                    评述人：
                </td>
                <td>
                    @if (true)
                    {
                        //TODO:此处应该根据登陆人，来选择展示驻地办评述人还是总监办评述人
                    }
                    @Html.TextBoxFor(model => model.ThePlmConstructionlogcivilInfo.Clc_DirectorMan, new { @class = "input02", @readonly = "true", Value = ViewBag.LoginRealName })
                </td>
            </tr>
            <tr>
                <td class="td1">
                    评述时间：
                </td>
                <td>
                    @if (true)
                    {
                        //TODO:此处应该根据登陆人，来选择展示驻地办评述时间还是总监办评述时间
                    }
                    @Html.TextBoxFor(model => model.ThePlmConstructionlogcivilInfo.Clc_DirectorDate, new { @class = "date input02", @readonly = "true", Value = @DateTime.Now.ToString("yyyy-MM-dd") })
                </td>
            </tr>
            @foreach (var item in Model.ThePlmConstructlogcivilList)
            {
                var sectionArray = item.Clc_ConstructionSection.Split(')');
                var sectionCode = sectionArray[0].Substring(1).Replace('-', '_');
                var sectionName = sectionArray[1];
                //TODO:此处应该根据登陆人，来选择展示驻地办评述还是总监办评述
                <tr>
                    @if (currentCode == "ZDJL" || currentCode == "JL")
                    {
                        <td class="td1">
                            @(sectionName)评述：
                        </td>
                    }
                    @if (currentCode == "ZDJL")
                    {
                        <td>
                            <textarea name="@(sectionCode)" cols="50" rows="4" class="input05">@item.Clc_StationComment</textarea>
                        </td>
                    }
                    else if (currentCode == "JL")
                    {
                        <td>
                            <textarea name="@(sectionCode)" cols="50" rows="4" class="input05">@item.Clc_DirectorComment</textarea>
                        </td>
                    }

                </tr>
            }
        </table>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit" class="btn btn-success btn-sm">
                            保存
                        </button>
                    </div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button class="close btn btn-default btn-sm" type="button">
                            取消
                        </button>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</form>
